// Win32 specific application definition
// Copyright 2006 (C) Ralph Thomas

#ifndef APPLICATION_WIN32_H
#define APPLICATION_WIN32_H

#include <toolkit/application.h>

#define WIN32_LEAN_AND_MEAN	// Remove excess fluff
#include <windows.h>

namespace toolkit {
	//
	/// The applicationWin32 class is an implementation of the 
	/// toolkit::application class for Win32 widgets. It handles
	/// initialization of the Win32 libraries and hands out the
	/// hInstance pointer to interested widgets.
	//
	class applicationWin32 : public application {
		class applicationWin32Impl* _impl;
		applicationWin32();
	  public:
		//
		// ~applicationWin32
		//
		/// This virtual destructor cleans up any resources used by
		/// the object.
		//
		virtual ~applicationWin32();
		//
		// applicationWin32& getInstance()
		//
		/// Return the single instance of this class.
		///
		/// \return	the single instance of this class.
		//
		static applicationWin32& getInstance();
		//
		// initReturn init()
		//
		/// Try to initialize the Win32 libraries. This should be
		/// called before any widgets are made.
		///
		/// \return any of the initReturn values
		//
		virtual initReturn init();
		//
		// void run()
		//
		/// Main-loop. Process events coming from windows.
		//
		virtual void run();
		//
		// void quit()
		//
		/// Force the main-loop (applicationWin32::run) to end
		/// and return.
		//
		virtual void quit();
		virtual void addIdle( idle* idleHandler, unsigned int freq );
		virtual void removeIdle( idle* idleHandler );
	};
};

#endif

